using System.Collections.Generic;
using System.Windows;

namespace MyEditor
{
    public partial class FolderSelectWindow : Window
    {
        public string SelectedFolder { get; private set; }

        public FolderSelectWindow(List<string> folders)
        {
            InitializeComponent();
            FolderListBox.ItemsSource = folders;
        }

        // 用户点击目录
        private void FolderListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (FolderListBox.SelectedItem is string folder)
            {
                SelectedFolder = folder;
                DialogResult = true; // 关闭窗口并返回
            }
        }

    }
}
